use std::io::{Read, Write};
use std::net::TcpListener;
fn main() {
    let listener = TcpListener::bind("127.0.0.1:3000").unwrap();
    println!("running server on port 3000");

    listener.incoming().for_each(|stream| {
        let mut stream = stream.unwrap();
        println!("connection established");
        let mut buffer = [0; 1024];

        stream.read(&mut buffer).unwrap();

        stream.write(&mut buffer).unwrap();
    });
}
